<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">

<body>
	<ui:composition template="templates/mainTemplate.xhtml">
		<ui:define name="content">
			<h:form id="myForm">
				<p:panel>
					<f:facet name="header">
						<h:outputText value="#{messages['itemSearch.title']}" />
					</f:facet>
					<h:panelGrid columns="1">
						<p:tabView effect="fade">
							<p:tab id="person" title="#{messages['itemSearch.person']}">
								<p:panelGrid columns="5">
									<f:facet name="header">
										<h:outputText value="#{messages['itemSearch.id']}" />
									</f:facet>
									<h:outputText value="#{messages['defineUserGroup.name']} : " />
									<p:inputText value="#{cSearchForm.personName}" />

									<h:outputText value="Id : " />
									<p:inputText value="#{cSearchForm.personId}" />

									<p:commandButton value="#{messages['itemSearch.search']}" action="#{cSearchAction.searchForPerson()}"
										style="float:right" update=":myForm:searchResult" />
								</p:panelGrid>
							</p:tab>
							<p:tab id="food" title="#{messages['itemSearch.food']}">
								<p:panelGrid columns="5">
									<f:facet name="header">
										<h:outputText value="#{messages['itemSearch.id']}" />
									</f:facet>
									<h:outputText value="#{messages['defineUserGroup.name']} : " />
									<p:inputText value="#{cSearchForm.foodName}" />

									<h:outputText value="Id : " />
									<p:inputText value="#{cSearchForm.foodId}" />

									<p:commandButton value="#{messages['itemSearch.search']}" action="#{cSearchAction.searchForFood()}"
										style="float:right" update=":myForm:searchResult" />
								</p:panelGrid>
							</p:tab>
							<p:tab id="table" title="#{messages['itemSearch.table']}">
								<p:panelGrid columns="5">
									<f:facet name="header">
										<h:outputText value="#{messages['itemSearch.id']}" />
									</f:facet>
									<h:outputText value="#{messages['defineUserGroup.name']} : " />
									<p:inputText value="#{cSearchForm.tableName}" />

									<h:outputText value="Id : " />
									<p:inputText value="#{cSearchForm.tableId}" />

									<p:commandButton value="#{messages['itemSearch.search']}" action="#{cSearchAction.searchForTable()}"
										style="float:right" update=":myForm:searchResult" />
								</p:panelGrid>
							</p:tab>
						</p:tabView>
						<br />
						<p:dataTable id="searchResult" value="#{cSearchForm.itemList}" var="result" paginator="true" rows="5">
							<p:column headerText="Id">
								<h:outputText value="#{result.id}" />
							</p:column>
							<p:column headerText="#{messages['defineUserGroup.name']}">
								<h:outputText value="#{result.name}" />
							</p:column>
							<p:column style="width:230px;">
								<p:commandButton value="#{messages['itemSearch.showCommands']}"
									action="#{cMenuAction.navigateToCommands(result)}" />
							</p:column>
						</p:dataTable>
					</h:panelGrid>
				</p:panel>
			</h:form>
		</ui:define>
	</ui:composition>
</body>
</html>